package UnOfficeDeTourisme;

/**
 * Interface definition : SGAssistanceVisiteur
 * 
 * @author OpenORB Compiler
 */
public abstract class SGAssistanceVisiteurPOA extends org.omg.PortableServer.Servant
        implements SGAssistanceVisiteurOperations, org.omg.CORBA.portable.InvokeHandler
{
    public SGAssistanceVisiteur _this()
    {
        return SGAssistanceVisiteurHelper.narrow(_this_object());
    }

    public SGAssistanceVisiteur _this(org.omg.CORBA.ORB orb)
    {
        return SGAssistanceVisiteurHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/SGAssistanceVisiteur:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("calculerItineraire")) {
                return _invoke_calculerItineraire(_is, handler);
        } else if (opName.equals("listerVisitesProche")) {
                return _invoke_listerVisitesProche(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_listerVisitesProche(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        UnOfficeDeTourisme.GPS arg1_in = UnOfficeDeTourisme.GPSHelper.read(_is);

        try
        {
            UnOfficeDeTourisme.Visite[] _arg_result = listerVisitesProche(arg0_in, arg1_in);

            _output = handler.createReply();
            UnOfficeDeTourisme.listeVisitesHelper.write(_output,_arg_result);

        }
        catch (UnOfficeDeTourisme.ListeVideException _exception)
        {
            _output = handler.createExceptionReply();
            UnOfficeDeTourisme.ListeVideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_calculerItineraire(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        UnOfficeDeTourisme.GPS arg1_in = UnOfficeDeTourisme.GPSHelper.read(_is);
        UnOfficeDeTourisme.mode arg2_in = UnOfficeDeTourisme.modeHelper.read(_is);

        float _arg_result = calculerItineraire(arg0_in, arg1_in, arg2_in);

        _output = handler.createReply();
        _output.write_float(_arg_result);

        return _output;
    }

}
